// ManagerWhiteboard
//
// This class represents the whiteboard space for all clerks to report events to the manager.
// This will include when lines are getting long or short, and when the theater is full.
// It will be protected by a monitor and be maintained by all the clerks and read by the manager
// to make reports.
//

class ManagerWhiteboard {
  public:
    ManagerWhiteboard(int numTicket, int numFood, int numTaker);			// Initialize the ManagerWhiteboard object, number of TicketClerk agents and number of TakerClerk agents
    ~ManagerWhiteboard();									// De-allocate ManagerWhiteboard
	
	static const int CLERK_NOMINAL = 0;		// Normal state for a clerk
	static const int CLERK_BREAK = 1;		// On Break state for a clerk
	
	static const int CLERK_LINE_NORM = 0;	// Line for this clerk is within range
	static const int CLERK_LINE_SHORT = 1;	// Line for this clerk is below a threshold
	static const int CLERK_LINE_FULL = 2;	// Line for this clerk is over a threshold.
	
	static const int TAKER_CLERK_TAKING_TICKETS = 0;	// This TakerClerk is currently letting people into the theater.
	static const int TAKER_CLERK_STOPPED = 1;			// This TakerClerk cannot let anyone else into the theater.
	
	bool isMovieRunning();								// returns if a movie is currently running.
	int getNumTicketClerks();							// returns the number of ticket clerks in the simulation
	int getNumFoodClerks();								// returns the number of food clerks in the simulation
	int getNumTakerClerks();							// returns the number of taker clerks in the simulation
    int getTicketClerkStatus(int clerkID); 				// returns current status of the given ticketClerk using the static constants
    int getTicketClerkLineStatus(int clerkID); 			// returns current status of the given ticketClerk line using the static constants
    int getFoodClerkStatus(int clerkID); 				// returns current status of the given foodClerk using the static constants
    int getFoodClerkLineStatus(int clerkID); 			// returns current status of the given foodClerk line using the static constants
    int getTakerClerkStatus(int clerkID); 				// returns current status of the given TakerClerk using the static constants
    int getTakerClerkLineStatus(int clerkID); 			// returns current status of the given TakerClerk line using the static constants
    int getTakerClerkTheaterStatus(int clerkID); 		// returns whether the taker clerk is letting people into the theater
	
	void setMovieRunning(bool movie);										// sets if a movie is currently running
	void setTicketClerkStatus(int clerkID, int status); 		// sets the ticketClerk status using one of the static constants
    void setTicketClerkLineStatus(int clerkID, int status); 	// sets the ticketClerk line status using one of the static constants
    void setFoodClerkStatus(int clerkID, int status); 			// sets the foodClerk status using one of the static constants
    void setFoodClerkLineStatus(int clerkID, int status); 		// sets the foodClerk line status using one of the static constants
    void setTakerClerkStatus(int clerkID, int status); 			// sets the takerClerk status using one of the static constants
    void setTakerClerkLineStatus(int clerkID, int status); 		// sets the takerClerk line status using one of the static constants
    void setTakerClerkTheaterStatus(int clerkID, int status); 	// sets the status of if this clerk is letting people into the theater or not
	
  private:
	bool movieRunning;				// if a movie is currently running
	int  numTicketClerks;			// number of ticket clerks
	int  numFoodClerks;				// number of food clerks
	int  numTakerClerks;			// number of taker clerks
    int* ticketClerkStatus;			// array of flags indicating the current status of each ticketClerk
	int* ticketClerkLineStatus;		// array of flags indicating the current status of the line for each ticketClerk
	int* foodClerkStatus;			// array of flags indicating the current status of each foodClerk
	int* foodClerkLineStatus;		// array of flags indicating the current status of the line for each foodClerk
	int* takerClerkStatus;			// array of flags indicating the current status of each ticketClerk
	int* takerClerkLineStatus;		// array of flags indicating the current status of the line for each ticketClerk
	int* takerClerkTheaterStatus; 	// array of flags indicating if these takerClerks can let anyone into the theater, used to determine when to start a movie.
};
